package com.fzy.modules.goods.service;

import com.fzy.core.common.IDUtils;
import com.fzy.modules.goods.dao.GoodsBomDao;
import com.fzy.modules.goods.entity.GoodsBom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;

/**
 * 子商品操作
 */
@Service
public class GoodsBomService {
    @Autowired
    GoodsBomDao goodsBomDao;
    /**
     * 查询某个商品的子商品
     */
    public List<GoodsBom> findAllList(String goodsId){
        return goodsBomDao.findAllList(goodsId);
    }
    /**
     * 增加子商品
     */
    public Integer save(GoodsBom goodsBom){
        goodsBom.setId(IDUtils.genItemId());
        return goodsBomDao.save(goodsBom);}
    /**
     * 修改子商品
     */
    public Integer update(GoodsBom goodsBom){
        return goodsBomDao.update(goodsBom);
    }
    /**
     * 删除子商品
     */
    public Integer delete(String id){return goodsBomDao.delete(id);}
}
